using System;
using Newtonsoft.Json;

namespace WWB.DisqusSharp.Model.DisqusDTO
{
    public class DisqusCategoryIdThread : DisqusFullIdentifiersThread
    {
        [JsonProperty("category")]
        public override string CategoryId { get; set; }

 
    }

    public abstract class DisqusFullIdentifiersThread : DisqusThread
    {
        [JsonProperty("identifier")]
        public string[] Identifier { get; set; }



        public override string[] Identifiers
        {
            get { return Identifier; }
        }

    }


    public class DisqusFullBodyThread : DisqusFullIdentifiersThread
    {
        public DisqusFullBodyThread()
        {
            Category = new Category();
        }

        [JsonProperty("category")]
        public Category Category { get; set; }

        #region Overrides of DisqusThread

        public override string CategoryId
        {
            get { return Category.Id; }
            set { Category.Id = value; }
        }
        #endregion
    }

    public class DisqusCreatedThread : DisqusThread
    {
        #region Overrides of DisqusThread

        public override string CategoryId
        {
            get { return string.Empty; }
            set
            {
                //do nothing 
            }
        }

        public override string[] Identifiers
        {
            get { return new string[]{Identifier}; }
        }

        [JsonProperty("identifier")]
        public string Identifier { get; set; }

        #endregion
    }

    public abstract class DisqusThread
    {
        public abstract string CategoryId { get; set; }

        [JsonProperty("allow_comments")]
        public bool AllowComments { get; set; }

        [JsonProperty("hidden")]
        public bool Hidden { get; set; }

        [JsonProperty("forum")]
        public string ForumId { get; set; }

        [JsonProperty("title")]
        public string Title { get; set; }

        [JsonProperty("url")]
        public string Url { get; set; }

        [JsonProperty("created_at")]
        public DateTime CreatedAt { get; set; }
        
        [JsonProperty("id")]
        public string Id { get; set; }

        [JsonProperty("slug")]
        public string Slug { get; set; }

        public abstract string[] Identifiers { get; }
    }
}